<?php
include_once("./_common.php");

//
$in_num = $in_num1."-".$in_num2;
$in_hp = $in_hp1."-".$in_hp2."-".$in_hp3;
$in_day1 = date("Y")."년 ".date("m")."월 ".date("d")."일";


//사인이미지 처리
if ($in_sign_img2 == "") {
	$signCfrm = "";
}
else {
	$signCfrm = "in_sign_img2 = '$in_sign_img2',";
}


//
$string = "vi_date = '$vi_date',
	vi_flag = '$vi_flag',
	vi_name1 = '$vi_name1',
	vi_name2 = '$vi_name2',
	vi_time = '$vi_time',
	vi_store = '$vi_store',
	vi_count = '$vi_count',
	vi_avg = '$vi_avg',
	vi_sales = '$vi_sales',
	vi_event = '$vi_event',
	vi_hall = '$vi_hall',
	vi_sign = '$vi_sign',
	vi_show = '$vi_show',
	vi_cash = '$vi_cash',
	vi_uni = '$vi_uni',
	vi_content = '$vi_content',
	vi_confirm = '$vi_confirm'";

if ($w == "")
{
	$sql = "INSERT
			INTO visit_record
			SET $string";
	$rst = sql_query($sql);
}
else if ($w == "u")
{
	$sql = "UPDATE visit_record
			SET $string
			WHERE id = '$id'";
	$rst = sql_query($sql);
}
else if ($w == "d")
{
	$sql = "DELETE
			FROM visit_record
			WHERE id = '$id'";
	$rst = sql_query($sql);
}


if ($g4[https_url])
    $https_url = "$g4[url]/adm/adm_new";
else
    $https_url = ".";

if ($file_upload_msg)
    alert($file_upload_msg, "{$https_url}/m_visit_list.php?bo_table=$bo_table&wr_id=$wr_id&page=$page" . $qstr);
else
    goto_url("{$https_url}/m_visit_list.php?bo_table=$bo_table&wr_id=$wr_id&page=$page" . $qstr);